﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Vit.Common;
using Vit.Web.Providers;
using Vit.Web.Mvc.DataAnnotations;

namespace Vit.Web.Models
{
    public class DataSourceItem
    {
        public DataSourceItem()
        {
            IsValid = true;
            ShowOrder = 1;
        }
        [StringLength(50)]
        [Key]
        [Column(Order = 1)]
        [DataSource(typeof(DataSourceCategory))]
        [UIHint("DataSource")]
        [FilterUIHint("DataSource")]
        [ShowFor(ShowForFilter = true)]
        public string CategoryName { get; set; }


        [StringLength(50)]
        [Key]
        [Column(Order = 2)]
        public string ItemName { get; set; }

        [StringLength(50)]
        [Required]
        public string ItemValue { get; set; }

        public int ShowOrder { get; set; }

        public bool IsValid { get; set; }

        public virtual DataSourceCategory Category { get; set; }
    }
}
